import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class HomeBar extends StatelessWidget {
  double sheetHeight = 0;
  final double h;
  HomeBar({super.key, this.h = 10});
  @override
  Widget build(BuildContext context) {
    return KeyboardVisibilityBuilder(builder: (context, isKeyboardVisible) {
      if (isKeyboardVisible) {
        sheetHeight = MediaQuery.of(context).viewInsets.bottom + h.w;
      } else {
        sheetHeight = MediaQuery.of(context).padding.bottom + MediaQuery.of(context).viewInsets.bottom + h.w;
      }
      return SizedBox(height: sheetHeight);
    });
  }
}
